package com.itheima;

import com.itheima.dao.UserDao;
import com.itheima.service.UserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {

        String location = "applicationContext.xml";
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(location);
        UserDao userDao = (UserDao) applicationContext.getBean("userDao");
        String name = userDao.getName();
        System.out.println(name);
        UserService userService = (UserService) applicationContext.getBean("userService");
        userService.save();
    }
}
